﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainStaff.aspx.cs" Inherits="CRMSalesManagement.Manage.StaffManage.MainStaff" %>
<%@ Register Assembly="DataPage" Namespace="DataPageTools" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>员工管理</title>
    <link href="../../Styles/MainStaffs.css" rel="stylesheet" type="text/css" />
    <link href="../../DataPage/css.css" rel="stylesheet" type="text/css" />
    <script src="http://localhost:61205/Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="http://localhost:61205/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
     <script type="text/javascript" language="javascript">
         function reload() { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(main) }
         function main(sender, args) {
             var hidden = document.getElementById("HiddenField1");
             if (hidden == null) {
                 return;
             }
             if (hidden.value != "") {
                 $("#" + hidden.value).children().first().css("background", "url(~/images/ManageImages/selected.png)");
             }
             //单击每一行的事件
             $("#gvStaff tr").click(function () {
                 //当前行第一个单元格设置背景图片
                 $(this).children().first().css("background", "url(~/images/ManageImages/selected.png)");
                 var thisID = $(this).attr("staffID");
                 hidden.value = thisID;
             });
         }
         $(function () {
             main();
             reload();
         });
         //屏蔽特殊字符
         function TextValidate() {
             var code;
             var character;
             var err_msg = "Text can not contain SPACES or any of these special characters  other than underscore (_) and hyphen (-).";
             if (document.all) //判断是否是IE浏览器 
             {
                 code = window.event.keyCode;
             }
             else {
                 code = arguments.callee.caller.arguments[0].which;
             }
             var character = String.fromCharCode(code);
             var txt = new RegExp("[\\`,\\~,\\!,\\@,\#,\\$,\\%,\\^,\\+,\\*,\\&,\\\\,\\/,\\?,\\|,\\:,\\.,\\<,\\>,\\{,\\},\\(,\\),\\',\\;,\\=,\"]");
             //特殊字符正则表达式（放到[]里，并用\\转义）
             if (txt.test(character)) {
                 alert("用户名不能包括空格或以下字符:\n  , ` ~ ! @ # $ % ^ + & * \\ / ? | : . < > {} () [] \" ");
                 if (document.all) {
                     window.event.returnValue = false;
                 }
                 else {
                     arguments.callee.caller.arguments[0].preventDefault();
                 }
             }
         } 
    </script>
    </head>
<body>
    <form id="form1" runat="server">
    <div class="staffContenter">
        <div class="tarlist">
            <div class="operate">
                <div class="amd">
                        <span>
                            <img alt="" src="../../images/ManageImages/add.png" style=" margin-bottom:-2px;"/>
                            <asp:HyperLink ID="hlAdd" runat="server" NavigateUrl="~/Manage/StaffManage/StaffAdd.aspx"
                                Target="iframes">添加</asp:HyperLink>
                        </span>
                        <span>
                            <img alt="" src="../../images/ManageImages/modify.png" style="margin-left: 62px;margin-bottom:-2px;" />
                            <asp:LinkButton ID="lbModify" runat="server" Text="修改"></asp:LinkButton>
                        </span>
                        <span style="padding-bottom: 2px;">
                            <img alt="" src="../../images/ManageImages/delete.png" style="margin-left: 62px;margin-bottom:-2px;" />
                            <asp:LinkButton ID="lbDelete" runat="server">删除</asp:LinkButton>
                        </span>
                    </div>
                     <div class="search_box">
                        <asp:TextBox ID="txt_Search" CssClass="s" runat="server" Width="125px" ondoubleclick="javascript:return false;"
                          onkeypress="TextValidate()"  Height="15px" MaxLength="10"></asp:TextBox>
                        <asp:ImageButton ID="imageReach" runat="server" ImageUrl="~/images/ManageImages/gou.png"
                            CssClass="imageReach" Width="17px" Height="16px" />
                        <asp:ImageButton ID="imageCancel" runat="server" CssClass="imageCancel" ImageUrl="~/images/ManageImages/cancel.png"
                             Height="18px" Width="17px" />
                    </div>
            </div>
        </div>
        <div class="mainlist">
         <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <div class="gridviewInfo">
                <div class="gridviewInfo" id="gvStaffList">
                    <asp:GridView ID="gvStaff" runat="server"  BorderStyle="Groove" CellPadding="0"
                            AutoGenerateColumns="False" Font-Size="12px" DataKeyNames="staffID" ForeColor="Black"
                            Width="100%" EnableTheming="True" PageSize="12" 
                        onrowdatabound="gvStaff_RowDataBound" 
                        onselectedindexchanging="gvStaff_SelectedIndexChanging">
                            <AlternatingRowStyle BackColor="#F2F7FF" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle Width="23px" CssClass="selectBar" />
                                <ItemTemplate>
                                    <asp:Button ID="btnSelsect" runat="server" CommandName="Select" Text="Button"  style=" display:none;"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="employeeID" HeaderText="工号">
                            <ItemStyle Height="23px" HorizontalAlign="Center" Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="name" HeaderText="姓名">
                            <ItemStyle Height="23px" HorizontalAlign="Center" Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="department" HeaderText="部门">
                            <ItemStyle Height="23px" HorizontalAlign="Center" Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="mobilePhone" HeaderText="移动电话">
                            <ItemStyle Height="23px" HorizontalAlign="Center" Width="100px" />
                            </asp:BoundField>
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" ForeColor="Black" Font-Bold="True" />
                        <HeaderStyle Font-Bold="False" BorderColor="Black" Height="23px" HorizontalAlign="Center"
                            VerticalAlign="Middle" CssClass="selectBar" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle Height="23px" />
                        <SelectedRowStyle BackColor="#65B8FF" Font-Bold="False" ForeColor="#333333" />
                    </asp:GridView>
                </div>
                <div class="DataPage">
                        <center>
                            <cc1:DataPage ID="DataPage1" runat="server" DIVClassName="yahoo" ShowRecordCount="15"
                                ShowPageNumberCount="10">
                                <PageIndex PageIndexType="TextBox"></PageIndex>
                            </cc1:DataPage>
                        </center>
                    </div>
            </div>
            <div class="staffDetail">
                <table>
                    <tr>
                        <th class="tit">工号：</th><th class="lbl">
                            <asp:Label ID="lblEmployeeID" runat="server"></asp:Label></th>
                        <th class="tit">姓名：</th><th class="lbl">
                            <asp:Label ID="lblName" runat="server"></asp:Label></th>
                    </tr>
                    <tr>
                        <th class="tit">性别：</th><th class="lbl">
                            <asp:Label ID="lblSex" runat="server"></asp:Label></th>
                        <th class="tit">年龄：</th><th class="lbl">
                            <asp:Label ID="lblAge" runat="server"></asp:Label></th>
                    </tr>
                    <tr style="border-bottom-style: groove; border-bottom-width: 1px">
                        <th class="tit">出生日期：</th><th class="lbl" colspan="3">
                            <asp:Label ID="lblBirthday" runat="server"></asp:Label></th>                    
                    </tr>
                    <tr>
                        <th class="tit">部门：</th><th class="lbl">
                            <asp:Label ID="lblDeparment" runat="server"></asp:Label></th>
                        <th class="tit">职务：</th><th class="lbl">
                            <asp:Label ID="lblPosition" runat="server"></asp:Label></th>
                    </tr>
                    <tr>
                        <th class="tit">进公司时间：</th><th class="lbl">
                            <asp:Label ID="lblEnter" runat="server"></asp:Label></th>
                        <th class="tit">状态：</th><th class="lbl">
                            <asp:Label ID="lblState" runat="server"></asp:Label></th>                        
                    </tr>
                    <tr>
                        <th class="tit">个人电话：</th><th class="lbl">
                            <asp:Label ID="lblMobile" runat="server"></asp:Label></th>
                        <th class="tit">家庭电话：</th><th class="lbl">
                            <asp:Label ID="lblHomephone" runat="server"></asp:Label></th>                        
                    </tr>                   
                    <tr>
                        <th class="tit">籍贯：</th><th class="lbl" colspan="3">
                            <asp:Label ID="lblAddress" runat="server"></asp:Label></th>                       
                    </tr>
                    <tr>
                        <th class="tit">更新日期：</th><th class="lbl" colspan="3">
                            <asp:Label ID="lblUpdate" runat="server"></asp:Label></th>                       
                    </tr>
                    <tr style=" height:50px;">
                        <th style=" height:50px; text-align:right; vertical-align:top;">备注：</th><th colspan="3" style=" vertical-align:top;">
                            <asp:Label ID="lblRemark" runat="server"></asp:Label></th>                       
                    </tr>
                </table>
            </div>
             </ContentTemplate>
        </asp:UpdatePanel>
        </div>
    </div>
    <asp:HiddenField ID="HiddenField1" runat="server" />
    </form>
</body>
</html>
